home *** CD-ROM | disk | FTP | other *** search
- #
- # AAA - first test executed in test suite
- # ----------------------------------------------------------------------
- # AUTHOR: Michael J. McLennan Phone: (215)770-2842
- # AT&T Bell Laboratories E-mail: aluxpo!mmc@att.com
- #
- # SCCS: @(#)AAA.test 1.2 (10/14/93)
- # ----------------------------------------------------------------------
- # Copyright (c) 1993 AT&T All Rights Reserved
- # ======================================================================
-
- # ----------------------------------------------------------------------
- # SHOULD HAVE A CLEAN SLATE
- # ----------------------------------------------------------------------
- test {No object info (no classes)} {
- itcl_info classes
- } {
- $result == ""
- }
-
- test {No object info (no objects)} {
- itcl_info objects
- } {
- $result == ""
- }
-
- # ----------------------------------------------------------------------
- # TEST CLASS AUTO-LOADING
- # ----------------------------------------------------------------------
- test {Force auto-loading through inheritance} {
- FooBar x
- } {
- $result == "x"
- }
-
- test {Info: all classes} {
- itcl_info classes
- } {
- [test_cmp_lists $result {Foo Bar FooBar}]
- }
-
- test {Info: all classes matching a pattern} {
- itcl_info classes *oo*
- } {
- [test_cmp_lists $result {Foo FooBar}]
- }
-
- # ----------------------------------------------------------------------
- # OBJECT AUTO-NUMBERING
- # ----------------------------------------------------------------------
- test {Create object with auto-naming} {
- FooBar #auto -blit x
- } {
- $result == "FooBar0" && [FooBar0 info public blit -value] == "x"
- }
-
- test {Create object with auto-naming} {
- FooBar #auto -blit y
- } {
- $result == "FooBar1" && [FooBar1 info public blit -value] == "y"
- }
-
- test {Auto-naming should avoid names already in use} {
- FooBar FooBar2
- FooBar FooBar3
- FooBar FooBar4
- FooBar #auto
- } {
- $result == "FooBar5"
- }
-
- test {Destroy all outstanding objects} {
- foreach obj [itcl_info objects] {
- $obj delete
- }
- } {
- $result == ""
- }
-